/********************************************************************************
 *      Copyright:  (C) 2022 znmzdx
 *                  All rights reserved.
 *
 *       Filename:  mqtt_config.h
 *    Description:  This head file 
 *
 *        Version:  1.0.0(23/05/22)
 *         Author:  Guo Wenxue <guowenxue@qmail.com>
 *      ChangeLog:  1, Release initial version on "23/05/22 13:32:46"
 *                 
 ********************************************************************************/
#ifndef MQTT_CONF_H
#define MQTT_CONF_H


#define  MAX_SIZE                1024
#define KEEP_ALIVE          60

enum{

    SUB ,
    PUB
};


typedef struct mqtt_user_data
{

     char       pub_topic[MAX_SIZE];
     char       sub_topic[MAX_SIZE];
     char       serial_no[MAX_SIZE];
     char       username[MAX_SIZE]; 
     char       passwd[MAX_SIZE];
     char       sample_data[MAX_SIZE];
     char       brokeraddress[MAX_SIZE];
     char       clientid[MAX_SIZE];
	 char       jsonid[MAX_SIZE];
	 char       method[MAX_SIZE];

     float      sample_temp;
     int        port;
     int        keep_alive;
     int        sample_time;
     int        sample_flag;

}mqtt_user_data_t;

int get_config(char *path, mqtt_user_data_t *mqtt);
int pack_json(mqtt_user_data_t *mqtt, char *msg);
#endif



